import request from "@/utils/request"
import { type Eassay, type Eassay_detaile } from "@/types/Eassy"
enum API {
    Essay = '/essay',
    One_Essay = '/essay/one'
}


export const essay_add = (data: Eassay) => request({
    method: "post",
    url: API.Essay,
    data
})

export const essay_list = (currentPage: number) => request({
    method: "get",
    url: API.Essay + `/${currentPage}`,
})
export const one_essay = (_id: string) => request({
    method: "get",
    url: API.One_Essay + `/${_id}`,

})
export const update_one_essay = (data: Eassay_detaile) => request({
    method: "put",
    url: API.One_Essay,
    data
})

export const delete_one = (_id: string) => request({
    method: "delete",
    url: API.One_Essay + `/${_id}`,

})